import React, { useEffect } from "react";
import { Empty, Button } from "antd-mobile";
import "./style.scss";
import $getQuery from "../../utils/app/$getQuery";
import { useNavigate } from "react-router-dom";

const ErrorPage = () => {
  const { roleType = "" } = $getQuery();
  
  const navigate: any = useNavigate();

  const back = () => {
    if (roleType === "user") {
        navigate("/home");
    } else if (roleType === "operator") {
        navigate("/activity/list");
    }
  };

  return (
    <div className="container_error">
      <Empty description="暂无权限" />
      <div className="that_button" onClick={back}>
        <Button>回到主页</Button>
      </div>
    </div>
  );
};

export default ErrorPage;
